package application;

import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import view.LibraryMainJFrame;

public class LibraryApp {
	private JFrame frame;
	private static LibraryApp instance;

	/**
	 * Create the application.
	 */
	private LibraryApp() {
		setLookAndFeel();
		frame = new LibraryMainJFrame();
	}
	
	public void start(){
		frame.setVisible(true);
	}
	
	public static LibraryApp getInstance(){
		if(instance == null){
			instance = new LibraryApp();
		}
		return instance;
	}

	//Setzt den "Look and Feel" auf das Systemeigene Design.
	private void setLookAndFeel() {	
		try {
			// Set System L&F
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (UnsupportedLookAndFeelException e) {
			// handle exception
		} catch (ClassNotFoundException e) {
			// handle exception
		} catch (InstantiationException e) {
			// handle exception
		} catch (IllegalAccessException e) {
			// handle exception
		}
	}
}
